<template>
  <section :class="[!isSetPageBackground ? 'c-bg-white' : '']">
    <cust-title-com v-if="item.isShowTitle" :marginSettings="item.styleParam && item.styleParam.marginSettings ? item.styleParam.marginSettings : null" :headLine="item.styleParam && item.styleParam.headLine ? item.styleParam.headLine : null" :titleName="item.title || '预约'" :titleDesc="item.desc" :showMoreType="item.showMoreType" :showMore="item.isShowMore" @clickMore="clickMoreBooking"></cust-title-com>
    <booking-com class="c-pt24" :marginSettings="item.styleParam && item.styleParam.marginSettings ? item.styleParam.marginSettings : null" :headLine="item.styleParam && item.styleParam.headLine ? item.styleParam.headLine : null" :visible="item.visible" :coverStyleType="item.items.coverStyleType" :bookingList='item.items.prods' :pageName="pageName" :showMore="item.isShowMoreBottom" @clickMore="clickMoreBooking"></booking-com>
  </section>
</template>
<script>
import custTitleCom from "@/components/templates/custIndexTemp/custTitleCom.vue";
import bookingCom from '@/components/templates/bookingCom.vue';
import { appRouterChange } from "@/mixin/appRouterPush.js";
export default {
  mixins: [appRouterChange],
  components: {
    custTitleCom,
    bookingCom
  },
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      },
    },
    pageName: {//首页INDEX 预览页PREVIEW_INDEX 微页面MICRO_PAGE
      type: String,
      default: "INDEX"
    },
    coverStyleType: {
      type: Number,
      default: 1
    },
  },
  data() {
    return {
      isSetPageBackground: sessionStorage.getItem("isSetPageBackground") || 0
    };
  },
  methods: {
    clickMoreBooking(e) {
      if (this.pageName == 'PREVIEW_INDEX') {
        return;
      }
      let toPath = "/homePage/booking/bookingList";
      this.iosAppRouteChange(toPath);
    },
  }
};
</script>
